package com.market.mapper;

import com.market.entity.Buyer;
import org.apache.ibatis.annotations.Mapper;

import java.io.IOException;
import java.util.List;

/**
 * @ClassName BuyerMapper
 * @Description TODO
 * @Author pq
 * @Date 2022/3/28 15:45
 * @Version 1.0
 */
@Mapper
public interface BuyerMapper {
    //买家注册
    int buyerRegister(Buyer buyer);

    //根据账号查询某个买家
    Buyer queryBuyerByAccount(String account);

    //根据账号密码查询该买家是否存在
    Buyer queryAccountByAccountAndPwd(String account, String pwd);

    //修改买家所在地址
    int updateBuyerAddress(int buyerId, String address);

    //修改基本买家信息(昵称，电话号码，地址，性别)
    int updateBuyerInfo(Integer buyerId, String nickname, String telephone, String address, String sex);

    //锁定买家
    int lockBuyer(int buyerId);

    //解锁买家
    int unLockBuyer(int buyerId);

    //根据买家id查看买家
    Buyer queryBuyerById(int buyerId);

    //查看所有买家
    List<Buyer> queryAllBuyer();

    //修改买家账户余额
    int updateBuyerBalance(int buyerId,double newBalance);

    //根据小店id查看买家
    List<Buyer> queryBuyerByStoreId(int storeId);

    int addStoreId(int buyerId,int storeId);
}